
<include file='Admin/Tpl/Public/nav.html' />
<link rel="stylesheet" href="__PUBLIC__/Css/pagestyle.css">   
    <!-- BEGIN PAGE CONTENT -->
    <div class="page-content"> 
        <div class="container-fluid">
            <!-- Begin page heading -->
            <h1 class="page-heading">Team In　<small>项目管理</small></h1>
            <!-- End page heading -->
            <div class="div1">
                <!-- Begin breadcrumb -->
                <ol class="breadcrumb default square rsaquo sm">
                    <li><a href="index.html"><i class="fa fa-home"></i></a></li>
                    <li><a href="__APP__">Teamin</a></li>
                    <li class="active">项目列表</li>
                </ol>
                <!-- End breadcrumb -->

                <div class="btn-group groups">
                    <a href="__URL__/forAct" class="btn btn-success"><i class="fa fa-plus"></i> 
                        添加新的项目
                    </a>
                </div>
                <!-- <div class="btn-group groups">
                    <span type="button" class="btn btn-danger"><i class="fa fa-ban"></i>功能尚未开启</span>
                </div> -->
                <!--查询-->
                <div class="btn-group pull-right">                               
                    <input id="search" type="text" class="form-control" placeholder="请输入要查询的项目名称">
                </div>
                <div class="div_search">
                <!-- BEGIN C3 CHART -->
                    <div class="the-box no-border">
                        <div class="table-responsive div1 div_search">
                            <table class="table table-th-block table-hover">
                                <thead>
                                    <tr style="text-align:center">
                                        <td style="text-align:center;width:80px">项目编号</td>
                                        <td style="text-align:center;width:80px">项目名称</td>
                                        <td style="text-align:center;width:180px">项目简介</td>
                                        <td style="text-align:center;width:180px">开始时间</td>
                                        <td style="text-align:center;width:100px">结束时间</td>
                                        <td style="text-align:center;width:80px">负责人</td>
                                        <td style="text-align:center;width:180px">操作</td>
                                    </tr>
                                </thead>
                                <tbody> 
                                        <volist name="datas" id="value"> 
                                            <tr>                    
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_id}
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_name}
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_description}
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_startTime}
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_endTime}
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    {$value.project_leader }
                                                </td>
                                                <td style='text-align:center;vertical-align:middle'>
                                                    <span class="save" name="{$value.project_id}">修改</span>|<span class="delete" id="{$value.project_id}">删除</span>
                                                </td>
                                            </tr>
                                        </volist>
                                </tbody>
                            </table>   
                            <ul class="pagination success">{$rs.show}</ul>
                        </div>
                        <div class="table-responsive" id="hl"></div>
                    </div>
                <!-- END C3 CHART -->
            </div>
        </div>
    </div>
            
    </body>    
    <script src="__PUBLIC__/assets/js/jquery.min.js"></script>
    <script type="text/javascript">
    $(".current").css({background:"#8CC152",color:"white"});
    $(".save").click(function(){
        var id = $(this).attr("name");        
        $.ajax({
            url:"__URL__/to_update",
            data:{"project_id":id},
            type:"get",
            success:function(data){

                $(".div1").css({display:"none"});
                $("#hl").html(data);
            }
        });
    });

     $(".delete").on("click",function(){
        var id = $(this).attr("id");
        var photo = $(this).attr("name");
        if(confirm("确认删除?")){
        $.ajax({
            url:"__URL__/delAct",
            data:{"project_id":id,"project_portrait":photo},
            type:"get",
            success:function(data){
               window.location="__SELF__";

            }
        })
        }
     });

//通讯录查询
   $("#search").keyup(function(){
    var name = $(this).val();
    $.ajax({
        url:"__URL__/search",
        data:{"seach":name},
        type:"get",
        success:function(data){
           $(".div_search").html(data);
        }
    });
});
//js添加背景颜色
var arr_color = Array("#434A54","#8CC152","#E9573F","#F6BB42","#AAB2BD","#37BC9B","#434A54","#8CC152","#E9573F","#F6BB42");
    for(var i=0;i<$(".div_box").length;i++){
        $(".div_box:eq("+i+")").css({background:arr_color[i],color:"white"})
    }
</script>
</html>



